<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<html>
<head>
    <title>课程表</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/all.min.css">
    <style>
        .container {
            padding: 20px;
        }
        .schedule-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
            background-color: white;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .schedule-table th, .schedule-table td {
            border: 1px solid #e7eaec;
            padding: 15px;
            text-align: center;
            vertical-align: top;
        }
        .schedule-table th {
            background-color: #f5f5f6;
            color: #333;
            font-weight: bold;
        }
        .schedule-table td {
            height: 100px;
        }
        .course-item {
            background-color: #1ab394;
            color: white;
            padding: 8px;
            margin-bottom: 5px;
            border-radius: 4px;
            font-size: 12px;
        }
        .course-item:last-child {
            margin-bottom: 0;
        }
        .course-name {
            font-weight: bold;
            margin-bottom: 3px;
        }
        .course-info {
            font-size: 11px;
            opacity: 0.9;
        }
        .time-column {
            width: 100px;
            background-color: #f9f9f9;
        }
        .top-bar {
            margin-bottom: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .title {
            font-size: 24px;
            color: #333;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="top-bar">
            <h2 class="title">课程表</h2>
        </div>

        <table class="schedule-table">
            <thead>
                <tr>
                    <th class="time-column">时间</th>
                    <th>星期一</th>
                    <th>星期二</th>
                    <th>星期三</th>
                    <th>星期四</th>
                    <th>星期五</th>
                    <th>星期六</th>
                    <th>星期日</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td class="time-column">08:00</td>
                    <c:forEach var="i" begin="1" end="7">
                        <td>
                            <c:forEach items="${scheduleMap['08:00'][i]}" var="subject">
                                <div class="course-item">
                                    <div class="course-name">${subject.subjectName}</div>
                                    <div class="course-info">
                                        ${subject.classroom}<br>
                                        ${subject.teacherName}
                                    </div>
                                </div>
                            </c:forEach>
                        </td>
                    </c:forEach>
                </tr>
                <tr>
                    <td class="time-column">09:00</td>
                    <c:forEach var="i" begin="1" end="7">
                        <td>
                            <c:forEach items="${scheduleMap['09:00'][i]}" var="subject">
                                <div class="course-item">
                                    <div class="course-name">${subject.subjectName}</div>
                                    <div class="course-info">
                                        ${subject.classroom}<br>
                                        ${subject.teacherName}
                                    </div>
                                </div>
                            </c:forEach>
                        </td>
                    </c:forEach>
                </tr>
                <tr>
                    <td class="time-column">10:00</td>
                    <c:forEach var="i" begin="1" end="7">
                        <td>
                            <c:forEach items="${scheduleMap['10:00'][i]}" var="subject">
                                <div class="course-item">
                                    <div class="course-name">${subject.subjectName}</div>
                                    <div class="course-info">
                                        ${subject.classroom}<br>
                                        ${subject.teacherName}
                                    </div>
                                </div>
                            </c:forEach>
                        </td>
                    </c:forEach>
                </tr>
                <tr>
                    <td class="time-column">11:00</td>
                    <c:forEach var="i" begin="1" end="7">
                        <td>
                            <c:forEach items="${scheduleMap['11:00'][i]}" var="subject">
                                <div class="course-item">
                                    <div class="course-name">${subject.subjectName}</div>
                                    <div class="course-info">
                                        ${subject.classroom}<br>
                                        ${subject.teacherName}
                                    </div>
                                </div>
                            </c:forEach>
                        </td>
                    </c:forEach>
                </tr>
                <tr>
                    <td class="time-column">14:00</td>
                    <c:forEach var="i" begin="1" end="7">
                        <td>
                            <c:forEach items="${scheduleMap['14:00'][i]}" var="subject">
                                <div class="course-item">
                                    <div class="course-name">${subject.subjectName}</div>
                                    <div class="course-info">
                                        ${subject.classroom}<br>
                                        ${subject.teacherName}
                                    </div>
                                </div>
                            </c:forEach>
                        </td>
                    </c:forEach>
                </tr>
                <tr>
                    <td class="time-column">15:00</td>
                    <c:forEach var="i" begin="1" end="7">
                        <td>
                            <c:forEach items="${scheduleMap['15:00'][i]}" var="subject">
                                <div class="course-item">
                                    <div class="course-name">${subject.subjectName}</div>
                                    <div class="course-info">
                                        ${subject.classroom}<br>
                                        ${subject.teacherName}
                                    </div>
                                </div>
                            </c:forEach>
                        </td>
                    </c:forEach>
                </tr>
                <tr>
                    <td class="time-column">16:00</td>
                    <c:forEach var="i" begin="1" end="7">
                        <td>
                            <c:forEach items="${scheduleMap['16:00'][i]}" var="subject">
                                <div class="course-item">
                                    <div class="course-name">${subject.subjectName}</div>
                                    <div class="course-info">
                                        ${subject.classroom}<br>
                                        ${subject.teacherName}
                                    </div>
                                </div>
                            </c:forEach>
                        </td>
                    </c:forEach>
                </tr>
                <tr>
                    <td class="time-column">17:00</td>
                    <c:forEach var="i" begin="1" end="7">
                        <td>
                            <c:forEach items="${scheduleMap['17:00'][i]}" var="subject">
                                <div class="course-item">
                                    <div class="course-name">${subject.subjectName}</div>
                                    <div class="course-info">
                                        ${subject.classroom}<br>
                                        ${subject.teacherName}
                                    </div>
                                </div>
                            </c:forEach>
                        </td>
                    </c:forEach>
                </tr>
            </tbody>
        </table>
    </div>
</body>
</html> 